// 材料相关接口
import request from '../service/service';

/**
 * 1、获取材料计划列表
 */
export function getMaterialList(data) {
  return request({
    protocol: '/bus/material/plan/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 新增材料计划
 */
export function addMaterial(data) {
  return request({
    protocol: '/bus/material/plan/create',
    options: data,
    method: 'post',
  });
}

/**
 * 修改材料计划
 */
export function updateMaterial(data) {
  return request({
    protocol: '/bus/material/plan/update',
    options: data,
    method: 'post',
  });
}

/**
 * 删除材料计划
 */
export function deleteMaterial(data) {
  return request({
    protocol: '/bus/material/plan/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 获取计划编号
 */
export function getMaterialPlanNo(data) {
  return request({
    protocol: '/bus/material/plan/getPlanNo',
    options: data,
    method: 'get',
  });
}

/**
 * 获取当前计划材料列表
 */
export function getMaterialDetailList(data) {
  return request({
    protocol: '/bus/material/plan/detail/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 明细反馈
 */
export function materialFeedback(data) {
  return request({
    protocol: '/bus/material/plan/detail/create/feedback',
    options: data,
  });
}

/**
 * 获取材料的反馈记录分页
 */
export function materialFeedbackList(data) {
  return request({
    protocol: '/bus/material/plan/detail/getPage/feedback',
    options: data,
    method: 'get',
  });
}

/**
 * 获取反馈待审核的计划集合
 */
export function getMaterialReviewPlanList(data) {
  return request({
    protocol: '/bus/material/plan/detail/getReviewPlanList',
    options: data,
    method: 'get',
  });
}

/**
 * 根据计划id获取需要审核的材料明细分页/根据明细id获取审核记录
 */
export function getReviewPlanDetailPage(data) {
  return request({
    protocol: '/bus/material/plan/detail/getReviewPlanDetailPage',
    options: data,
    method: 'get',
  });
}

/**
 * 审核反馈
 */
export function reviewMaterialFeedBack(data) {
  return request({
    protocol: '/bus/material/plan/detail/reviewFeedBack',
    options: data,
    method: 'get',
  });
}

/**
 * 获取反馈待阅读的计划集合
 */
export function getMaterialReadPlanList(data) {
  return request({
    protocol: '/bus/material/plan/detail/getReadPlanList',
    options: data,
    method: 'get',
  });
}

/**
 * 阅读需求计划
 */
export function readMaterialPlan(data) {
  return request({
    protocol: '/bus/material/plan/readPlan',
    options: data,
    method: 'post',
    hasQuery: true,
  });
}

/**
 * 阅读需求计划反馈
 */
export function readPlanFeedBack(data) {
  return request({
    protocol: '/bus/material/plan/detail/readPlanFeedBack',
    options: data,
    method: 'post',
    hasQuery: true,
  });
}

/**
 * 材料进场分页列表
 */
export function materialStockInList(data) {
  return request({
    protocol: '/bus/material/stock/in/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 材料进场新增
 */
export function addStockInMaterial(data) {
  return request({
    protocol: '/bus/material/stock/in/create',
    options: data,
    method: 'post',
  });
}

/**
 * 材料进场删除
 */
export function delStockInMaterial(data) {
  return request({
    protocol: '/bus/material/stock/in/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 材料进场修改
 */
export function updateStockInMaterial(data) {
  return request({
    protocol: '/bus/material/stock/in/update',
    options: data,
    method: 'post',
  });
}

/**
 * 类型分页列表
 */
export function getStockTypeList(data) {
  return request({
    protocol: '/bus/material/stock/type/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 类型新增
 */
export function addStockType(data) {
  return request({
    protocol: '/bus/material/stock/type/create',
    options: data,
    method: 'post',
  });
}

/**
 * 类型删除
 */
export function delStockType(data) {
  return request({
    protocol: '/bus/material/stock/type/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 类型修改
 */
export function updateStockType(data) {
  return request({
    protocol: '/bus/material/stock/type/update',
    options: data,
    method: 'post',
  });
}

/**
 * 类型规格新增
 */
export function addStockTypeModel(data) {
  return request({
    protocol: '/bus/material/stock/type/model/create',
    options: data,
    method: 'post',
  });
}

/**
 * 类型规格删除
 */
export function delStockTypeMode1l(data) {
  return request({
    protocol: '/bus/material/stock/type/model/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 根据类型id查询规格集合
 */
export function getStockModelList(data) {
  return request({
    protocol: '/bus/material/stock/type/model/getList',
    options: data,
    method: 'get',
  });
}

/**
 * 材料离场分页列表
 */
export function getStockOutList(data) {
  return request({
    protocol: '/bus/material/stock/out/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 材料离场
 */
export function addStockOut(data) {
  return request({
    protocol: '/bus/material/stock/out/create',
    options: data,
    method: 'post',
  });
}

/**
 * 材料离场删除
 */
export function delStockOut(data) {
  return request({
    protocol: '/bus/material/stock/out/deleteByIds',
    options: data,
    method: 'post',
  });
}

/**
 * 材料进场/离场查看
 */
export function getStockSelectPage(data) {
  return request({
    protocol: '/bus/material/stock/stock/selectPage',
    options: data,
    method: 'get',
  });
}

/**
 * 删除需求计划
 */
export function deleteMaterialPlan(data) {
  return request({
    protocol: '/bus/material/plan/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 删除需求计划材料
 */
export function delMaterialPlanDetail(data) {
  return request({
    protocol: '/bus/material/plan/detail/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 获取材料规格统计
 */
export function getMaterialSpecStatic(data) {
  return request({
    protocol: '/bus/material/plan/getMaterialSpecStatic',
    options: data,
    method: 'get',
  });
}
